From: Florian Müllner Date: Sat, 21 Apr 2018 16:39:10 +0000 (+0200) Subject: polkitAgent: Guard against repeated close() calls X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~84 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0327069e83bc1ecedd909891e2a1f70df6269606;p=gnome-shell.git polkitAgent: Guard against repeated close() calls We use the close() method to disconnect signal handlers set up in init(), however the handler ID is only valid in the first call in case the method is called more than once. https://gitlab.gnome.org/GNOME/gnome-shell/issues/221 --- diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 316bc2ad1..7a0682c4b 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -201,7 +201,9 @@ var AuthenticationDialog = new Lang.Class({ close(timestamp) { this.parent(timestamp); - Main.sessionMode.disconnect(this._sessionUpdatedId); + if (this._sessionUpdatedId) + Main.sessionMode.disconnect(this._sessionUpdatedId); + this._sessionUpdatedId = 0; }, _ensureOpen() {